package com.sunflower.bath.service.impl;


import java.util.List;
import org.framework.mybatis.Criteria;
import org.sunflower.framework.utils.UUIDUtils;

import com.sunflower.bath.model.JobParams;
import com.sunflower.bath.repository.IJobParamsRepository;
import com.sunflower.bath.service.IJobParamsService;


public class JobParamsServiceImpl implements IJobParamsService{

	public List<JobParams> queryPage(Criteria<JobParams> param){
		List<JobParams> list = jobParamsRepository.queryPage(param); 
		return list;  }

	public Integer queryPageCount(Criteria<JobParams> param){
		return (Integer) jobParamsRepository.queryPageCount(param);
	}

	public JobParams queryEntityById(String id){
		return jobParamsRepository.queryEntityById(id);
	}

	public String insert(JobParams record){
		String id = UUIDUtils.shortUuidAddTime();
		record.setParamId(id);
		int result = jobParamsRepository.insert(record);
		if ( result != 1) { 
			return "新增参数数据失败！";
		} 
		return null;
	}

	public String updateByCriteria(Criteria<JobParams> param){
		int result = jobParamsRepository.updateByCriteria(param);
		if ( result != 1) { 
			return "更新参数数据失败！";
		} 
		return null;
	}

	public String deleteById(String id){
		int result = jobParamsRepository.deleteById(id);
		if ( result != 1) { 
			return "删除参数数据失败！";
		} 
		return null;
	}

	public String deleteByCriteria(Criteria<JobParams> param){
		jobParamsRepository.deleteByCriteria(param);
		return null;
	}

	public void setJobParamsRepository(IJobParamsRepository repository) {this.jobParamsRepository = repository;}
	private IJobParamsRepository jobParamsRepository;


}
